home *** CD-ROM | disk | FTP | other *** search
/ C/C++ Interactive Reference Guide / C-C++ Interactive Reference Guide.iso / c_ref / csource4 / 223_01 / reverse.c < prev    next >
Text File  |  1979-12-31  |  384b  |  17 lines

  1. #define NOCCARGC  /* no argument count passing */
  2. /*
  3. ** reverse string in place 
  4. */
  5.   static char *j;
  6.   static int c;
  7.  
  8. reverse(s) char *s; {
  9.   j = s + strlen(s) - 1;
  10.   while(s < j) {
  11.     c = *s;
  12.     *s++ = *j;
  13.     *j-- = c;
  14.     }
  15.   }
  16.  
  17.